//
//  LzwSearchCollectCell.m
//  NewHalfsugar
//
//  Created by 刘志武 on 16/1/5.
//  Copyright © 2016年 刘志武. All rights reserved.
//

#import "LzwSearchCollectCell.h"
#import "LzwBaseImageView.h"
#import "LzwBaseLable.h"
#import "UIImageView+WebCache.h"

@interface LzwSearchCollectCell ()

@property (nonatomic, retain) LzwBaseImageView *mySearchImage;
@property (nonatomic, retain) LzwBaseLable *mySearchLable;

@end


@implementation LzwSearchCollectCell

-(void)dealloc{
    [_mySearchImage release];
    [_mySearchLable release];
    [super dealloc];
}

-(instancetype)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    
    if (self) {
        [self creatCollect];
    }
    return self;
}


- (void)creatCollect{
    
    self.mySearchImage = [[LzwBaseImageView alloc]initWithFrame:CGRectMake(10 * WIDTH, 0, 60 * WIDTH, 60 * WIDTH)];
    [self.contentView addSubview:self.mySearchImage];
    
    self.mySearchLable = [[LzwBaseLable alloc]initWithFrame:CGRectMake(10 * WIDTH, 60 * WIDTH, self.mySearchImage.frame.size.width, 20 * WIDTH)];
    self.mySearchLable.textAlignment = NSTextAlignmentCenter;
    self.mySearchLable.font = [UIFont systemFontOfSize:15 * WIDTH];
    self.mySearchLable.alpha = 0.4;
    [self.contentView addSubview:self.mySearchLable];
    
}

-(void)setModleSea:(LzwSearchModle *)modleSea{
    
    if (_modleSea != modleSea) {
        [_modleSea release];
        _modleSea = [modleSea retain];
    }
    
    self.mySearchLable.text = self.modleSea.name;
    
    NSURL *urlS = [NSURL URLWithString:self.modleSea.icon];
    
    [self.mySearchImage sd_setImageWithURL:urlS placeholderImage:nil];
    
}

@end
